package com.yanti.controller;

import com.yanti.domain.ResponseResult;
import com.yanti.domain.dto.UserAnswerSubmitDTO;
import com.yanti.service.UserCommitResultsService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/question")
public class UserCommitResultController {

    @Resource
    private UserCommitResultsService userCommitResultsService;

    @PostMapping("/answerUpload")
    public ResponseResult userUpLoadAnswer(@RequestBody UserAnswerSubmitDTO submitDTO){
        return userCommitResultsService.userUpLoadAnswer(submitDTO);
    }

    // 新增暂存答案接口方法
    @PostMapping("/temporary-save")
    public ResponseResult temporarySaveAnswer(@RequestBody UserAnswerSubmitDTO submitDTO) {
        return userCommitResultsService.userTemporarySaveAnswer(submitDTO);
    }
}
